package com.feidee.data.report.util;

import com.alibaba.fastjson.JSONObject;
import com.feidee.data.report.dao.IRedisDao;
import com.feidee.data.report.dao.IRealTimeReportDao;

import java.util.Map;
import java.util.concurrent.Callable;

public class RealTimeReportThread implements Callable<Map<Map<String, JSONObject>, Map<String, JSONObject>>> {
	private IRealTimeReportDao realTimeReportDao;
	private IRedisDao redisDao;
	private String dimStr;
	private String sql;

	public RealTimeReportThread(IRealTimeReportDao realTimeReportDao, IRedisDao redisDao, String dimStr, String sql) {
		this.realTimeReportDao = realTimeReportDao;
		this.redisDao = redisDao;
		this.dimStr = dimStr;
		this.sql = sql;
	}

	@Override
	public Map<Map<String, JSONObject>, Map<String, JSONObject>> call() throws Exception {
		Map<Map<String, JSONObject>, Map<String, JSONObject>> resultMap = realTimeReportDao.runSql(redisDao, dimStr, sql);
		return resultMap;
	}
}
